var mysql = require('mysql');
var connection = mysql.createConnection({
  host: '127.0.0.1',
  user: 'root',
  password: '123456',
  database: 'opgg',
  port: '3306',
  multipleStatements: true
});

connection.connect();
module.exports = (sql) => {
  return new Promise(next => {
    connection.query(sql, function (error, results, fields) {
      if (error) throw error;
      //console.log('The solution is: ', results[0].solution);
      next(results)
    })
    //connection.end();
  });
}